<?php

class Com_member{
	
	function __construct($ainfo=null){
		$this->user = Afun_db_uc()->model(Acan_table_uc_members);
		$this->info = Afun_db()->model(Acan_table_info_member);
		
	}
	//基础信息(返回对象)
	function info($uid=""){
		if(empty($uid)){$uid=$_SESSION['auser']['uid'];}
		$model = $this->user->findPk($uid);
		foreach ($model as $key => $val) {
			if(is_int($key)){continue;}
			$data->$key = $val;
		}
		return $data;
	}
	//用户扩展信息
	function info_ex($uid=""){
		if(empty($uid)){$uid=$_SESSION['auser']['uid'];}
		$info = Afunc_info(Acan_table_info_member)->data('member_info',$uid,'all');
		return $info;
	}
	//更新信息
	function update($saveinfo,$uid){
		Afunc_info(Acan_table_info_member)->update('member_info',$saveinfo,$uid);
	}
	//保存信息
	function save($saveinfo,$uid){
		Afunc_info(Acan_table_info_member)->save('member_info',$saveinfo,$uid);
	}
	
	
}

?>